//
//  InputSystem.h
//  Monster_Martial_Arts_Version_0
//
//  Created by bk on 13/1/6.
//  Copyright (c) 2013年 __MyCompanyName__. All rights reserved.
//

#ifndef Monster_Martial_Arts_Version_0_CInputSystem_h
#define Monster_Martial_Arts_Version_0_CInputSystem_h

#include "Singleton.h"
#include "InputDef.h"
#include "IInputListen.h"
#include <vector>
#include <map>

using namespace std;

class CInputAction;
class CInputSystem :public Singleton<CInputSystem>
{
public:
    
    CInputSystem(){}
    
    virtual ~CInputSystem(){}
    
    virtual void Init();
    
    void Update();
    
    void AddListen(IInputListen*);
    
    void RemoveAllListen();
    
    void AddAction(CInputAction*);
    
    void RemoveAllAction();
    
    CInputAction* GetInputAction(INPUT_ID);
    
protected:    
    
    void SendActionEvent(INPUT_ID inputID , float valueX , float valueY);
    
    void IsUpdateInpute(CInputAction*);
    
private:
    
    vector<IInputListen*> m_vInputListen;
    
    //vector<CInputAction*> m_vInputAction;
    
    map<INPUT_ID,CInputAction*> m_mapInputAction;
    
};



#endif
